package structural.adapter.object;

/**
 * @ClassName: SDAdapterTF
 * @Description: 对象适配器类：实现了SDCard，聚合了TFCard
 * @Author: liu-hao
 * @Date: 2023-04-11 11:41
 * @Version: 1.0
 **/
public class SDAdapterTF implements SDCard {

    TFCard tfCard;

    public SDAdapterTF(TFCard tfCard) {
        this.tfCard = tfCard;
    }

    @Override
    public String readSD() {
        System.out.println("adapter read tf card");
        return tfCard.readTF();
    }

    @Override
    public void writeSD(String msg) {
        System.out.println("adapter write tf card");
        tfCard.writeTF(msg);
    }
}
